package com.yc.project.dao;

import com.yc.common.util.DBHelper;

import java.util.Map;

public class DishDao {
    public Map<String, Object> selectById(String id) {
        String sql = "select * from gghc_dish where id=?";
        return DBHelper.selectOneMap(sql, id);
    }
    public int setViewsById(String id) {
        String sql = "update gghc_dish set viewsNum = viewsNum + 1 where id = ? ";
        return DBHelper.update(sql,id);
    }
    public Map<String, Object> selectKnameById(String id) {
        String sql = "select kname from gghc_kind a INNER JOIN gghc_dish b where b.id=? and b.sort=a.id";
        return DBHelper.selectOneMap(sql, id);
    }
}
